﻿/*********************弘石项目三组************************
*  功能描述：绩效管理：考核任务控制器
*  作者：刘伟康
*  时间：2021-12-13
*  修改人：刘伟康
*  修改时间：2021-12-13
*********************弘石项目三组************************/
using Hong.Business.Business_AssessmentManagement;
using Hong.Model.SysDomain.Model_AssessmentManagement;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WeHongshibApI.Controllers.Controllers_AssessmentManagement
{
    [ApiExplorerSettings(GroupName = "Assessment")]
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class AssessmentController : ControllerBase
    {
        #region 构造器注入
        private readonly AssessmentBusiness _dal;
        public AssessmentController(AssessmentBusiness dal)
        {
            _dal = dal;
        }
        #endregion

        #region 考核任务
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="assessmentList"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddAssessmentList(AssessmentList assessmentList)
        {
            var i = _dal.AddAssessmentList(assessmentList);
            return Ok(i);
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetAssessmentList()
        {
            var list = _dal.GetAssessmentList();
            return Ok(list);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        [HttpPut]
        public IActionResult PutAssessmentList(AssessmentList assessmentList)
        {
            var i = _dal.PutAssessmentList(assessmentList);
            return Ok(i);
        }
        /// <summary>
        /// 反填
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetAssessmentListFT(string id)
        {
            var list = _dal.GetAssessmentListFT(id);
            return Ok(list);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        [HttpDelete]
        public IActionResult DeleteAssessmentList(string id)
        {
            var obj = _dal.DeleteAssessmentList(id);
            return Ok(obj);
        }
        /// <summary>
        /// 归档
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public IActionResult PostAssessmentList(string id)
        {
            var list = _dal.PostAssessmentList(id);
            return Ok(list);
        }
        #endregion
    }
}
